package com.capacity;

import android.app.Application;
import android.content.Context;
import android.support.multidex.MultiDex;
import android.support.multidex.MultiDexApplication;

import com.facebook.react.ReactApplication;
import com.cmcewen.blurview.BlurViewPackage;
import com.reactlibrary.RNSyanImagePickerPackage;
import com.mehcode.reactnative.splashscreen.SplashScreenPackage;
import com.brentvatne.react.ReactVideoPackage;
import com.reactlibrary.RNSyanImagePickerPackage;
import com.lewin.qrcode.QRScanReaderPackage;
import com.github.yamill.orientation.OrientationPackage;
import org.reactnative.camera.RNCameraPackage;
import com.github.yamill.orientation.OrientationPackage;



import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;

import java.util.Arrays;
import java.util.List;
import org.pgsqlite.SQLitePluginPackage;

public class MainApplication extends MultiDexApplication implements ReactApplication {

  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    @Override
    public boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
            new BlurViewPackage(),
            new RNSyanImagePickerPackage(),
            new SplashScreenPackage(),
            new ReactVideoPackage(),
            new QRScanReaderPackage(),
            new OrientationPackage(),
            new RNCameraPackage(),


            new SQLitePluginPackage()
      );
    }



    @Override
    protected String getJSMainModuleName() {
      return "index";
    }
  };

  @Override
  protected void attachBaseContext(Context base) {
    super.attachBaseContext(base);
    MultiDex.install(this);
  }
  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
  }
}
